package com.esiran.payadmin.config;

import com.esiran.payadmin.util.SysUtil;
import freemarker.template.TemplateModelException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

@Configuration
public class FreeMarkerConfig {
    private final freemarker.template.Configuration configuration;
    @Autowired
    public FreeMarkerConfig(freemarker.template.Configuration configuration) {
        this.configuration = configuration;
    }
    @PostConstruct
    public void setConfiguration() throws TemplateModelException {
        configuration.setSharedVariable("sysUtil",new SysUtil());
    }
}
